<?php
class LogAction extends LoginAction
{
    public function index ()
    {
        $LogModel = M('Log');
        $allCount = $LogModel->count();
        $Page = $this->getPage($allCount);
        $logs = $LogModel->field('id,`table`,log,`key`,create_time')
            ->order('id DESC')
            ->limit($Page->firstRow . ',' . $Page->listRows)
            ->select();
        $this->assign('logs', $logs);
        $this->assign('page', $Page->show());
        $this->display();
    }
    
    public function login(){
    	$LogModel = M('LoginLog');
    	$allCount = $LogModel->count();
    	$Page = $this->getPage($allCount);
    	$logs = $LogModel->order('login_time DESC')
    	->limit($Page->firstRow . ',' . $Page->listRows)
    	->select();
    	$this->assign('logs', $logs);
    	$this->assign('page', $Page->show());
    	$this->display();
    }
}
?>